import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import { Redirect } from "react-router-dom";

class User extends PureComponent {
  constructor(props) {
    super(props);

    this.state = {
      isLogin: false,
    };
  }
  render() {
    return this.state.isLogin ? (
      <div>
        <h2>User</h2>
        <h2>用户名：coderwhy</h2>
      </div>
    ) : (
      <Redirect to="/login"></Redirect>
    );
  }
}

User.propTypes = {};

export default User;
